package com.testplatfrom.project.enumproject.environment;


/***
 * HTTP 配置启用条件枚举
 */
public enum EnablingConditions {
    NOTHAVE("NOTHAVE","无"),
    MODULE("MODULE","模块"),
    ROUTE("ROUTE","路径")
    ;
    private String httpEbablingMethod;

    private String msg;

    public String getHttpEbablingMethod() {
        return httpEbablingMethod;
    }

    public void setHttpEbablingMethod(String httpEbablingMethod) {
        this.httpEbablingMethod = httpEbablingMethod;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    EnablingConditions(String httpEbablingMethod, String msg) {
        this.httpEbablingMethod = httpEbablingMethod;
        this.msg = msg;
    }

    EnablingConditions() {
    }

    @Override
    public String toString() {
        return "EnablingConditions{" +
                "httpEbablingMethod='" + httpEbablingMethod + '\'' +
                ", msg='" + msg + '\'' +
                '}';
    }

    /**
     *
     * @param httpEbablingMethod
     * @return
     */
    public static EnablingConditions getByKey(String httpEbablingMethod){
        for (EnablingConditions assertMethodsType:values()){
            if (httpEbablingMethod.equals(assertMethodsType.getHttpEbablingMethod())){
                return assertMethodsType;
            }
        }
        return null;
    }
}
